/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.manage.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import javax.persistence.Entity;
import javax.persistence.Table;

import me.zhengjie.modules.map.domain.BasicMap;
import org.hibernate.annotations.*;
import java.sql.Timestamp;
import java.math.BigDecimal;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author yyj
* @date 2023-09-05
**/
@Entity
@Data
@Table(name="manage_house_ele")
public class HouseEle implements Serializable {

    @Id
    @Column(name = "id")
    @ApiModelProperty(value = "id")
    private String id;

    @Column(name = "name")
    @ApiModelProperty(value = "家具家电名字")
    private String name;

    @Column(name = "type")
    @ApiModelProperty(value = "类型1家具2家电")
    private String type;

    @Column(name = "param")
    @ApiModelProperty(value = "功能参数")
    private String param;

    @Column(name = "expire_time")
    @ApiModelProperty(value = "过期时间")
    private Timestamp expireTime;

    @Column(name = "year")
    @ApiModelProperty(value = "质保年限")
    private String year;

    @Column(name = "duty_tel")
    @ApiModelProperty(value = "负责人电话")
    private String dutyTel;

    @Column(name = "duty_person")
    @ApiModelProperty(value = "负责人")
    private String dutyPerson;

    @Column(name = "brand")
    @ApiModelProperty(value = "品牌")
    private String brand;

    @Column(name = "source")
    @ApiModelProperty(value = "来源")
    private String source;

    @Column(name = "pic_path")
    @ApiModelProperty(value = "文件")
    private String picPath;

    @Column(name = "price")
    @ApiModelProperty(value = "价格")
    private BigDecimal price;

    @Column(name = "gis_x")
    @ApiModelProperty(value = "x轴")
    private String gisX;

    @Column(name = "gis_y")
    @ApiModelProperty(value = "y轴")
    private String gisY;

    @OneToOne
    @JoinColumn(name = "map_id")
    @ApiModelProperty(value = "所属图层")
    private BasicMap mapId;

    @Column(name = "create_by")
    @ApiModelProperty(value = "创建人")
    private String createBy;

    @Column(name = "create_time")
    @CreationTimestamp
    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    public void copy(HouseEle source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}